class textcache
{
public:
int curpic[MAX_TEXTURE_UNITS];
int npic,curtextunit;
virtual void use(int pic=-1,int textunit=0)=0;
virtual void use_triangles(int pic=-1,int textunit=0)=0;
virtual void init(int np,picture **pic)=0;
virtual int add_picture(int sx,int sy,int bytespixel,unsigned char
*lm)=0;
virtual void update_picture(int picnum,int sx,int sy,int bytespixel,unsigned
char *buf)=0;
virtual void update_sub_picture(int picnum,int x,int y,int sx,int
sy,int bytespixel,unsigned char *buf)=0;
textcache()
{
memset(curpic,-1,sizeof(int)*MAX_TEXTURE_UNITS);
npic=0;
curtextunit=0;
};
virtual ~textcache() { };
};
Member | Type | Description |
---|---|---|
curpic | int [] | the current selected texture in each texture unit |
npic | int | the total number of textures |
curtextunit | int | the current selected texture unit |
use, use_triangles, init, add_picture, update_picture, update_sub_picture
This class in the base class for the texture cache (texture manager). Sub-classes
from this class should implement their functionality by implementing the virtual
functions using the the selected graphics API.
Use the flyEngine init_texture_cache and free_texture_cache to
initialize and free the global variable tc that is the main interface to
this class.